package Day19;

/**
 * @author hyhWTX
 * @version 1.0
 * @date 2022年03月19日 16:21
 */

/*
    (2)根据人类，派生一个学生类Student.

            a.增加属性：学校school、学号stuNumber;

            b.重写工作方法(学生的工作是学习)。
 */
public class Student extends  Person{
    private String school;
    private String stuNumber;


    public Student(String name, String gender, int age,  String school, String stuNumber) {
        super(name, gender, age);
        this.school = school;
        this.stuNumber = stuNumber;
    }

    public void work(){
        System.out.println("好好学习，天天向上");
    }
    public void show(){
        System.out.println("姓名："+super.getName()+"，性别："+super.getGender()+"，年龄："+super.getAge()+"，学校："+this.getSchool()+",学号:"+this.getStuNumber());
        work();
    }

    public String getSchool() {
        return school;
    }

    public void setSchool(String school) {
        this.school = school;
    }

    public String getStuNumber() {
        return stuNumber;
    }

    public void setStuNumber(String stuNumber) {
        this.stuNumber = stuNumber;
    }
}


